#define DEBUG
#include <cstdio>

using namespace std;

int main() {
  freopen("factory.in", "r", stdin);
  freopen("factory.out", "w", stdout);

  int n, ans=0;
  scanf("%d", &n);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      int t;
      scanf("%1d", &t);
      ans += !t;
    }
  }
  printf("%d", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
